﻿#region Copyright ©2008-2011, Technische Universitaet Muenchen
// ====================================================================================================
//
// Last Changed by       $Author: kalus $
// Last Changed Date     $LastChangedDate: 2009-03-18 16:42:33 +0100 (Wed, 18 Mar 2009) $
// Last Changed Revision $Rev: 36 $
//
// ====================================================================================================
#endregion

using System;
using System.IO;

namespace Tum.CollabXT.TFS
{
    /// <summary>
    /// Base class for TFS provider exceptions.
    /// </summary>
    public class TFSException : CollabXTException
    {
        public TFSException(string message)
            : base(message)
        { }

        public TFSException(string message, Exception innerException)
            : base(message, innerException)
        { }
    }

    /// <summary>
    /// Exception when an invalid template configuration file is loaded.
    /// </summary>
    public class TemplateConfigInvalidException : TFSException
    {
        public TemplateConfigInvalidException()
            : base(string.Empty)
        { }

        public TemplateConfigInvalidException(string message)
            : base(message)
        { }
    }

    /// <summary>
    /// Exception that is thrown when a copy operation fails.
    /// </summary>
    public class FileCopyException : IOException
    {
        /// <summary>
        /// Source file of the copy operation.
        /// </summary>
        public string SourcePath
        {
            get;
            private set;
        }

        /// <summary>
        /// Destination file of the copy operation.
        /// </summary>
        public string DestinationPath
        {
            get;
            private set;
        }

        /// <summary>
        /// Constructor.
        /// </summary>
        public FileCopyException(string source, string destination, IOException innerException)
            : base(innerException.Message, innerException)
        {
            SourcePath = source;
            DestinationPath = destination;
        }
    }
}
